package cn.coisini.api.search;

import cn.coisini.model.common.dtos.Result;
import cn.coisini.model.common.enums.ResultEnum;
import cn.coisini.model.dto.AssociateWordsDto;
import cn.coisini.model.dto.UserSearchDto;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @author xiangshaw
 * Description: 联想词接口API
 */
@Tag(name = "联想词接口API", description = "")
@RequestMapping("/api/v1/view/search/associate")
public interface AssociateWordsControllerApi {

    @Operation(summary = "查询搜索词联想")
    @GetMapping("/load")
    Result<List<AssociateWordsDto>> getAssociateWords(UserSearchDto userSearchDto);

    @Operation(summary = "新增搜索联想词")
    @GetMapping("/add")
    void addAssociateWords(AssociateWordsDto associateWordsDto);

    @Operation(summary = "删除搜索联想词")
    @DeleteMapping("/delete")
    Result<ResultEnum> delAssociateWords(@RequestBody AssociateWordsDto associateWordsDto);
}
